import { Routes, RouterModule } from "@angular/router";
import { LoginComponent } from './components/login/login.component';
import { RegisterComponent } from './components/register/register.component';
import { AccountComponent } from './components/account/account.component';
import { NotificationsComponent } from './components/notifications/notifications.component';
import { SearchtrainingsComponent } from './components/searchtrainings/searchtrainings.component';
import { CurrenttrainingsComponent } from './components/currenttrainings/currenttrainings.component';
import { CompletedtrainingsComponent } from './components/completedtrainings/completedtrainings.component';
import { EditskillsComponent } from './components/editskills/editskills.component';
import { NgModule } from '@angular/core';
import { TechnologiesComponent } from './components/technologies/technologies.component';

const appRoutes: Routes = [
    { path: '', redirectTo: '/searchtrainings', pathMatch: 'full' }, // 默认定向到list
    { path: 'login', component: LoginComponent },
    { path: 'register', component: RegisterComponent },
    { path: 'account', component: AccountComponent },
    { path: 'technologies', component: TechnologiesComponent },
    { path: 'notifications', component: NotificationsComponent },
    { path: 'searchtrainings', component: SearchtrainingsComponent },
    { path: 'currenttrainings', component: CurrenttrainingsComponent },
    { path: 'completedtrainings', component: CompletedtrainingsComponent },
    { path: 'editskills', component: EditskillsComponent }
];

@NgModule({
    imports: [
        RouterModule.forRoot(
            appRoutes,
            { enableTracing: true } // <-- debugging purposes only
        )
    ],
    exports: [
        RouterModule
    ]
})
export class AppRoutingModule { }